package com.snail.billing.page;

import android.os.Bundle;
import android.view.View;
import android.webkit.WebView;
import android.widget.TextView;

import com.android.util.ResUtil;
import com.snail.billing.Resource;
import com.snail.billing.os.DialogPage;
import com.snail.billing.util.WebViewOption;

public class RegisterProtocolPage extends DialogPage implements View.OnClickListener {

	private TextView textTitle;
	private View buttonBack;

	private WebView webView;

	@Override
	public int createLayoutId() {
		return ResUtil.getLayoutId(Resource.layout.snailbilling_register_protocol_activity);
	}

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		textTitle = (TextView) findViewById(ResUtil.getViewId(Resource.id.snailbilling_title_text));
		textTitle.setText(ResUtil.getString(Resource.string.snailbilling_register_protocol_title));
		buttonBack = findViewById(ResUtil.getViewId(Resource.id.snailbilling_title_button_back));
		buttonBack.setOnClickListener(this);
		//
		webView = (WebView) findViewById(ResUtil.getViewId(Resource.id.snailbilling_register_protocol_web_view));
		WebViewOption.option(webView);
		webView.loadUrl(ResUtil.getString(Resource.string.snailbilling_config_register_protocol));
	}

	@Override
	public void onClick(View v) {
		if (v.equals(buttonBack)) {
			getPageManager().backward();
		}
	}

}
